package paramTest
{
	
	import flash.display.Graphics;
	import flash.display.MovieClip;
	import flash.display.Shape;
	
	public class ColorTest extends MovieClip
	{
		//-----------------------------------------------------------------------------------
		// public vars
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// protected / internal vars
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// private vars
		//-----------------------------------------------------------------------------------
		private var shape : Shape;
		//-----------------------------------------------------------------------------------
		// public functions
		//-----------------------------------------------------------------------------------	
		public function ColorTest()
		{
			super();
			trace("===> ColorTest , ColorTest : " );
			shape = this.getChildAt(0) as Shape;
				
			
		}
		
		//Array, Boolean, Color, Font Name, List, Number, Object, String
		[Inspectable(name="viewColor", defaultValue = "#00ff00", type = Color )]
		public function set viewColor ( value : Number ):void
		{
			if( shape && this.contains( shape ) )		
			{
				drawRect( value );
			}
		}
		
		private function drawRect( value : Number ):void
		{
			var shape : Shape = new Shape();
			var g : Graphics = shape.graphics;
			g.beginFill( value );
			g.drawRect( 0,0, this.width , this.height );
			g.endFill();
			this.addChild( shape );
		}
		
		//-----------------------------------------------------------------------------------
		// private functions
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// event handler
		//-----------------------------------------------------------------------------------
	}
	
}